package com.gitee.vueantd;

import com.gitee.vueantd.common.annotation.rest.AnonymousGetMapping;
import com.gitee.vueantd.common.utils.SpringContextHolder;
import io.swagger.annotations.Api;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.RestController;

/**
 * 开启审计功能 -> @EnableJpaAuditing
 *
 * @author Zheng
 * @date 2021/9/30 10:20:19
 */
@EnableAsync
@RestController
@Api(hidden = true)
@SpringBootApplication
@EnableTransactionManagement
@EnableJpaAuditing(auditorAwareRef = "auditorAware")
public class VueAntdApplication {

  public static void main(String[] args) {
    SpringApplication.run(VueAntdApplication.class, args);
  }

  @Bean
  public SpringContextHolder springContextHolder() {
    return new SpringContextHolder();
  }

  /**
   * 访问首页提示
   *
   * @return /
   */
  @AnonymousGetMapping("/")
  public String index() {
    return "Backend service started successfully";
  }

}
